package com.etc.traval.bizimpl;

import java.util.List;

import com.etc.traval.biz.StrategyBiz;
import com.etc.traval.dao.StrategyDao;
import com.etc.traval.daoimpl.StrategyDaoImpl;
import com.etc.travel.entity.Place;
import com.etc.travel.entity.Strategy;

public class StrategyBizImpl implements StrategyBiz {

	StrategyDao dao = new StrategyDaoImpl();

	@Override
	public boolean strategyAdd(Strategy strategy) {
		if (strategy.getStrategy_content() == null) {
			return false;
		}
		if (strategy.getStrategy_title() == null) {
			return false;
		}
		if (strategy.getStrategy_user() == null) {
			return false;
		}
		return dao.strategyAdd(strategy);
	}
	
	@Override
	public Strategy querySTrategyById(int id) {
		return dao.querySTrategyById(id);
	}

	@Override
	public List<Strategy> querySTrategyByPlace(Place place,int page,int size) {
		return dao.querySTrategyByPlace(place,page,size);
	}

	@Override
	public boolean deleteStrategyById(int id) {
		return dao.deleteStrategyById(id);
	}

	@Override
	public List<Strategy> queryAllStrategy(int page, int size) {
		return dao.queryAllStrategy(page, size);
	}

	@Override
	public List<Strategy> queryAllStrategyByAdmin(int page, int size) {
		// TODO Auto-generated method stub
		return dao.queryAllStrategyByAdmin(page, size);
	}

	@Override
	public boolean updatestrategyok(int id) {
		// TODO Auto-generated method stub
		return dao.updatestrategyok(id);
	}

}
